package com.yatb.trac.controller.common.loaders;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yatb.trac.pojo.Profilo;
import com.yatb.trac.service.SearchService;

public class LoadProfili implements HttpObjectsLoader {

	private SearchService searchService ;
	public void load(HttpServletRequest request, HttpServletResponse response) {
		if(request.getSession(false).getAttribute("profili")==null){
			Profilo[] profili = getSearchService().find(new Profilo[0], Profilo.class);
			request.getSession(false).setAttribute("profili", profili);
		}
	}
	public SearchService getSearchService() {
		return searchService;
	}
	public void setSearchService(SearchService searchService) {
		this.searchService = searchService;
	}

}
